using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Webcar.BLL;
using ToolsLayer;
using BusinessEntity;
using PersistenceLayer;
using System.Collections.Generic;

namespace Webcar.Sec
{
    public partial class DriverStudyList : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GridViewStyler gvs = new GridViewStyler(this.GridView1);
            gvs.SetStyle();
            if (this.IsPostBack)
                return;
            
        }

        protected void SearchClick(object sender, EventArgs e)
        {
            GridViewStyler gvs = new GridViewStyler(this.GridView1);
            gvs.SetGridHover = false;
            gvs.SetStyle();
            string sql = "exec v_study_list_year '{0}','{1}'";
            sql = string.Format(sql,this.SearchByYear1.GetYear(),this.SearchByYear1.GetDeptCode());
            DataSet ds = DB.ExecuteDataset(sql);
            this.GridView1.DataSource = ds;
            this.GridView1.DataBind();
        }

        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowIndex == -1)
                return;
            for(int i =0;i<13;i++)
            {
                if (e.Row.Cells[i].Text == "未学习")
                    e.Row.Cells[i].ForeColor = System.Drawing.Color.Red;
            }
        }
    }
}
